package leetbook.string;

public class Solution8 {

    public static void main(String[] args) {
        System.out.println((char)255);
    }

    //字符串中的第一个唯一字符
    public int firstUniqChar(String s) {
        int[] count = new int[26];
        for (int i = 0; i < s.length(); i++) {
            count[s.charAt(i)-'a']++;
        }
        for (int i = 0; i < s.length(); i++) {
            if(count[s.charAt(i)-'a']==1)
                return s.charAt(i);
        }
        return 0;
    }
}
